package org.persistente.xml;

/**
 *
 * @author philipe
 */
public class CallbackParser<T> extends ListParser<T> {
    
    private Callback<T> callback;

    public CallbackParser(String childName, CompositeParser<T> parser, Callback<T> callback) {
        super(childName, parser);
        this.callback = callback;
    }
    

    @Override
    public void use(Context context, String attribute, Object value) {
        callback.execute((T)value);
    }
    
    
    
}
